import { fromJS } from 'immutable'; // 引入immutable.js库，防止state对象被错误赋值

// immutable对象
const defaultState = fromJS({
    isLogin: false,
});

const reducer = (state = defaultState, action) => {
    switch (action.type) {
        case 'LOGIN':
            return state.set('isLogin', action.isLogin);
        default:
            return state;
    }
};

export default reducer;
